﻿//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Text;
//using System.Diagnostics.Tracing;

//namespace DisableEvent
//{
//    public class Subscriber
//    {
//        private EventSource _eventSource;

//        public Subscriber(EventSource source)
//        {
//            _eventSource = source;
//            _eventSource.PropertyChanged += Source_PropertyChanged;
//        }

//        private void Source_PropertyChanged(object sender, PropertyChangedEventArgs e)
//        {
//            //
//        }

//        public void DoWithoutEvents()
//        {
//            using (new DisableEvent(_eventSource, this, "Source_PropertyChanged"))
//            {
//                // Source_PropertyChanged function will not be called inside this block
//                _eventSource.Property = 1;
//            }
//        }
//    }
//}
